<head>
    <title>简单的文件上传</title>
</head>

<body>
<h1>简单的文件上传</h1>
{{> uploadForm}}
{{> uploadedFiles}}
</body>

<template name="uploadForm">
    <!--{{#with currentUpload}}-->
        <!--上传<b>{{file.name}}</b>-->
        <!--<span id="progress">{{progress.get}}%</span>-->
    <!--{{else}}-->
        <input id="fileInput" type="file"/>
        <p>
            <small>上传文件必须是jpeg，png，且大小不能超过10MB</small>
        </p>
    <!--{{/with}}-->
</template>

<template name="uploadedFiles">
    {{#if uploadedFiles.count}}
        <ul>
            {{#each file in uploadedFiles.each}}
                <li>
                    <a href="{{file.link}}?download=true" download="{{file.name}}" title="{{file.link}}">{{file.name}}</a>
                    <p>{{file.link}}</p>
                </li>
            {{/each}}
        </ul>
    {{else}}
        <div>没文件下载！</div>
    {{/if}}
</template>